<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:om="http://www.openmath.org/OpenMath" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:c="jelly:core" xmlns:x="jelly:xml"
                xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events"
                xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:monet="http://monet.nag.co.uk/monet/ns" xmlns:xlink="http://www.w3.org/1999/xlink">

	<xsl:include href="common.xsl"/>
	<xsl:include href="openmath2mathml.xsl"/>
	<xsl:output method="xml"/>

	<xsl:template match="/page">
		<!--the path is relative to the output file directory-->
		<xsl:processing-instruction name="xml-stylesheet" select="('type=&quot;text/xsl&quot;','href=&quot;../../../../Workspace/GTextbook/src/presentation/style/mathml.xsl&quot;')"/>
		<html>
			<head>
				<title>
					<xsl:value-of select="@name"/>
				</title>
				<meta name="generator" content="GeoGebra"/>
				<style type="text/css">body {font-size: medium}
				h4{font-size:100%}
				.concept{TEXT-DECORATION:none}
				a.concept:hover {background: #6e8bde}
				a.concept:hover {color: #ffffff}
				a.concept:link {color: #000000}</style>
				<script type="text/javascript" src="D:/Workspace/GTextbook/src/presentation/javascript/LaTeXMathML.js"></script>
				<link rel="stylesheet" type="text/css" href="D:/Workspace/GTextbook/src/presentation/css/LaTeXMathML.standardarticle.css"/>
				<script type="text/javascript" src="D:/Workspace/GTextbook/src/presentation/javascript/Feel.js">
				</script>
				<script type="text/javascript" src="D:/Workspace/GTextbook/src/presentation/javascript/Judge.js">
				</script>
			</head>
			<body>
				<xsl:apply-templates/>
			</body>
		</html>
	</xsl:template>

	<xsl:template match="category">
		<xsl:if test="@layer=1">
			<xsl:element name="h1">
				<xsl:attribute name="align">center</xsl:attribute>
				<xsl:value-of select="@role"/>
				<xsl:text>:	    	</xsl:text>
				<xsl:value-of select="@name"/>
			</xsl:element>
		</xsl:if>
		<xsl:if test="@layer=2">
			<xsl:element name="h2">
				<xsl:attribute name="align">center</xsl:attribute>
				<xsl:if test="//page/@language='english'">
					<xsl:value-of select="@role"/>
					<xsl:text> </xsl:text>
					<xsl:number count="category/category" level="multiple" format="1.1.1. "/>
				</xsl:if>
				<xsl:if test="//page/@language='中文'">
					<xsl:text>第 </xsl:text>
					<xsl:number count="category/category" level="multiple" format="1.1.1 "/>
					<xsl:value-of select="@role"/>
				</xsl:if>
				<xsl:text>		   </xsl:text>
				<xsl:value-of select="@name"/>
			</xsl:element>
		</xsl:if>
		<xsl:if test="@layer=3">
			<xsl:element name="h4">
				<xsl:attribute name="align">center</xsl:attribute>
				<xsl:if test="//page/@language='english'">
					<xsl:value-of select="@role"/>
					<xsl:text> </xsl:text>
					<xsl:number count="category/category" level="multiple" format="1.1.1. "/>
				</xsl:if>
				<xsl:if test="//page/@language='中文'">
					<xsl:text>第 </xsl:text>
					<xsl:number count="category/category" level="multiple" format="1.1.1 "/>
					<xsl:value-of select="@role"/>
				</xsl:if>
				<xsl:text>		   </xsl:text>
				<xsl:value-of select="@name"/>
			</xsl:element>
		</xsl:if>
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="visualization">
	</xsl:template>



	<xsl:template match="theorem">
		<xsl:choose>
			<xsl:when test="@type or @name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Theorem <xsl:number count="category/category|theorem" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="//page/@language='中文'">定理<xsl:number count="category/category|theorem" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
					<!--form>
						<input type="button">
							<xsl:attribute name="onclick">
								<xsl:text>ProofOf</xsl:text>
								<xsl:text>();</xsl:text>
							</xsl:attribute>
							<xsl:attribute name="value">
								<xsl:if test="//page/@language='english'">Prove in GEOTHER</xsl:if>
								<xsl:if test="//page/@language='中文'">在GEOTHER中证明</xsl:if>
							</xsl:attribute>
						</input>
					</form>
					<applet archive="file:///D:/Workspace/prove.jar" code="Prove" name="ProveApplet"></applet>

					<script type="text/javascript">
		function ProofOf<xsl:text>()</xsl:text> {
 		document.ProveApplet.main(); 
	}</script-->
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Theorem</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="lemma">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Lemma <xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="//page/@language='中文'">引理<xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Lemma</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="corollary">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Corollary <xsl:number count="category/category|corollary" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="//page/@language='中文'">推论<xsl:number count="category/category|corollary" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Corollary</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="axiom">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Axiom <xsl:number count="category/category|axiom" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="//page/@language='中文'">公理<xsl:number count="category/category|axiom" level="multiple" format="1.1.1"/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Axiom</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="conjecture">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Conjecture <xsl:number count="category/category|conjecture" level="multiple" format="1.1.1"/></xsl:if>
						<xsl:if test="//page/@language='中文'">猜想<xsl:number count="category/category|conjecture" level="multiple" format="1.1.1"/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Conjecture</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="problem">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Problem <xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="//page/@language='中文'">问题<xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Problem</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="exercise">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Exercise <xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="//page/@language='中文'">练习<xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Exercise</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="example">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Example <xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="//page/@language='中文'">例 <xsl:number count="category/category|lemma" level="multiple" format="1.1.1 "/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Example</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="proof">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Proof <xsl:number count="category/category|proof" level="multiple" format="1.1.1"/></xsl:if>
						<xsl:if test="//page/@language='中文'">证明<xsl:number count="category/category|proof" level="multiple" format="1.1.1"/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Proof</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="definition">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h4>
						<xsl:value-of select="@type"/>
					</h4>
				</xsl:if>
				<xsl:if test="@name">
					<h4>
						<xsl:if test="//page/@language='english'">Definition <xsl:number count="category/category|definition" level="multiple" format="1.1.1"/></xsl:if>
						<xsl:if test="//page/@language='中文'">定义<xsl:number count="category/category|definition" level="multiple" format="1.1.1"/></xsl:if>
						<xsl:if test="not(@name='null')">
							<xsl:text>  ( </xsl:text>
							<xsl:value-of select="@name"/>
							<xsl:text> )</xsl:text>
						</xsl:if>
					</h4>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h4>Definition</h4>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>


	<xsl:template match="introduction">
		<xsl:if test="./title">
			<h4 align="center">
				<xsl:value-of select="./title"/>
			</h4>
		</xsl:if>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="remark">

		<h4>
			<xsl:if test="//page/@language='english'">Remark.</xsl:if>
			<xsl:if test="//page/@language='中文'">注.</xsl:if>
			<xsl:if test="./title">
				<xsl:value-of select="./title"/>
			</xsl:if>
		</h4>

		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="para">
		<p>
			<xsl:apply-templates/>
		</p>
	</xsl:template>

	<xsl:template match="concept">
		<em>
			<b>
				<xsl:apply-templates/>
			</b>
		</em>
	</xsl:template>

	<xsl:template match="equation">
		<xsl:choose>
			<xsl:when test="@style">
				<xsl:if test="string(@style) = 'center'">
					<div align="center">
						<xsl:apply-templates/>
					</div>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<div>
					<xsl:apply-templates/>
				</div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>


	<xsl:template match="figure">
		<img>
			<xsl:attribute name="src">
				<xsl:value-of select="@src"/>
			</xsl:attribute>
			<xsl:attribute name="align">
				<xsl:text>middle</xsl:text>
			</xsl:attribute>
			<xsl:attribute name="height">300</xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="alt">
				<xsl:value-of select="@name"/>
			</xsl:attribute>
			<xsl:attribute name="title">
				<xsl:value-of select="@name"/>
			</xsl:attribute>
			<a>
				<xsl:attribute name="name">
					<xsl:if test="//page/@language='english'">figure_</xsl:if>
					<xsl:if test="//page/@language='中文'">图_</xsl:if>
					<xsl:value-of select="@name"/>
				</xsl:attribute>
			</a>
		</img>
	</xsl:template>

	<xsl:template match="link">
		<a>
			<xsl:choose>
				<xsl:when test="@type">
					<xsl:attribute name="class">
						<xsl:value-of select="@type"/>
					</xsl:attribute>
					<xsl:attribute name="href">#<xsl:value-of select="@type"/>_<xsl:value-of select="@name"/></xsl:attribute>
					<xsl:value-of select="@type"/>: <xsl:value-of select="@name"/></xsl:when>
				<xsl:when test="@author and @role">
					<xsl:attribute name="class">
						<xsl:value-of select="@role"/>
					</xsl:attribute>
					<xsl:attribute name="href">
						<xsl:value-of select="@author"/>_<xsl:value-of select="@role"/>_<xsl:value-of select="@name"/>.xml</xsl:attribute>
					<xsl:value-of select="@role"/>
					<xsl:value-of select="@name"/>
				</xsl:when>
				<xsl:when test="@role and not(@author)">
					<xsl:attribute name="class">
						<xsl:value-of select="@role"/>
					</xsl:attribute>
					<xsl:attribute name="href">
						<xsl:text>Administrator_</xsl:text>
						<xsl:value-of select="@role"/>_<xsl:value-of select="@name"/>.xml</xsl:attribute>
					<xsl:value-of select="@role"/>
					<xsl:text>: </xsl:text>
					<xsl:value-of select="@name"/>
				</xsl:when>
			</xsl:choose>
		</a>
	</xsl:template>

	<!--xsl:template match="reference">
		<a>
			<xsl:attribute name="href">file:///D:/GTextbook/Geometry Revisited/source/Administrator_<xsl:value-of select="@role"/>_<xsl:value-of select="@name"/>.xml</xsl:attribute>
			<xsl:apply-templates/>
		</a>
	</xsl:template-->

	<!--items-->
	<xsl:template match="formalDefinition">
		<p>
			<b>
				<xsl:if test="//page/@language='english'">Formal definition:</xsl:if>
				<xsl:if test="//page/@language='中文'">形式化定义：</xsl:if>
			</b>
			<div>
				<xsl:apply-templates/>
			</div>
		</p>
	</xsl:template>

	<xsl:template match="formalRepresentation">
		<p>
			<b>
				<xsl:if test="//page/@language='english'">Formal representation:</xsl:if>
				<xsl:if test="//page/@language='中文'">形式化表示：</xsl:if>
			</b>
			<div>
				<xsl:apply-templates/>
			</div>
		</p>
	</xsl:template>

	<xsl:template match="algebraicScript">
		<p>
			<b>
				<xsl:if test="//page/@language='english'">Algebraic Script:</xsl:if>
				<xsl:if test="//page/@language='中文'">代数化脚本：</xsl:if>
			</b>
			<div>
				<xsl:apply-templates/>
			</div>
		</p>
	</xsl:template>



	<xsl:template match="translationScript">
		<p>
			<b>
				<xsl:if test="//page/@language='english'">Translation Script:</xsl:if>
				<xsl:if test="//page/@language='中文'">翻译脚本：</xsl:if>
			</b>
			<div>
				<xsl:apply-templates/>
			</div>
		</p>
	</xsl:template>


	<xsl:template match="algebraicRepresentation">
		<p>
			<b>
				<xsl:if test="//page/@language='english'">Algebraic representation:</xsl:if>
				<xsl:if test="//page/@language='中文'">代数表示：</xsl:if>
			</b>
		</p>
		<div>
			<xsl:apply-templates/>
		</div>
	</xsl:template>

	<xsl:template match="nondegeneracyCondition">
		<xsl:if test="./*">
			<p class="nondegeneracyCondition">
				<b>
					<xsl:if test="//page/@language='english'">Nondegeneracy condition:</xsl:if>
					<xsl:if test="//page/@language='中文'">非退化条件：</xsl:if>
				</b>
				<div>
					<xsl:apply-templates/>
				</div>
			</p>
		</xsl:if>
	</xsl:template>

	<xsl:template match="coordinatize">
		<p>
			<title>Coordinatize</title>
			<xsl:apply-templates/>
		</p>
	</xsl:template>

	<xsl:template match="hypothesis">
		<b>
			<xsl:if test="//page/@language='english'">Hypothesis</xsl:if>
			<xsl:if test="//page/@language='中文'">假设</xsl:if>
		</b>
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="conclusion">
		<b>
			<xsl:if test="//page/@language='english'">Conclusion</xsl:if>
			<xsl:if test="//page/@language='中文'">结论</xsl:if>
		</b>
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="naturalRepresentation">
		<p>
			<xsl:apply-templates/>
		</p>
	</xsl:template>


	<xsl:template match="categoryNote">
		<xsl:if test="./title">
			<h4 align="center">
				<xsl:value-of select="./title"/>
			</h4>
		</xsl:if>
		<xsl:apply-templates/>
		<hr></hr>
	</xsl:template>

	<xsl:template match="err">
		<xsl:choose>
			<xsl:when test="@type or @ name">
				<xsl:if test="@type">
					<h1>
						<xsl:value-of select="@type"/>
					</h1>
				</xsl:if>
				<xsl:if test="@name">
					<h2>Error: <xsl:value-of select="@name"/></h2>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<h1>Error</h1>
			</xsl:otherwise>
		</xsl:choose>
		<para>written err</para>
	</xsl:template>

	<xsl:template match="diagramInstruction|diagramScript">
		<form>
			<input type="button">
				<xsl:attribute name="onclick">
					<xsl:text>ConstructionOf</xsl:text>
					<xsl:value-of select="replace(translate(@name,'.','_'),'\W+','')"/>
					<xsl:text>();</xsl:text>
				</xsl:attribute>
				<xsl:attribute name="value">
					<xsl:if test="//page/@language='english'">Draw</xsl:if>
					<xsl:if test="//page/@language='中文'">画图</xsl:if>
				</xsl:attribute>
			</input>
		</form>
		<p>
			<a>
				<xsl:attribute name="name">
					<xsl:if test="//page/@language='english'">dynamicFigure_</xsl:if>
					<xsl:if test="//page/@language='中文'">动态图形_</xsl:if>
					<xsl:value-of select="@name"/>
				</xsl:attribute>
			</a>
			<applet archive="file:///D:/Workspace/GTextbook/src/geogebra/geogebra.jar" code="geogebra.GeoGebraApplet" codebase="./" height="400" width="500">
				<xsl:attribute name="name">
					<xsl:value-of select="replace(translate(@name,'.','_'),'\W+','')"/>
					<xsl:text>Applet</xsl:text>
				</xsl:attribute>
				<param name="filename">
					<xsl:attribute name="value">
						<xsl:text>file:///D:/Workspace/GTextbook/src/geogebra/blank.ggb</xsl:text>
					</xsl:attribute>
				</param>
				<param name="framePossible" value="false"></param>
				<param name="showResetIcon" value="true"></param>
				<param name="enableRightClick" value="true"></param>
				<param name="showMenuBar" value="false"></param>
				<param name="showToolBar" value="false"></param>
				<param name="showToolBarHelp" value="false"></param>
				<param name="showAlgebraInput" value="false"></param>
			</applet>
		</p>

		<script type="text/javascript">var applet;
		function ConstructionOf<xsl:value-of select="replace(translate(@name,'.','_'),'\W+','')"/><xsl:text>()</xsl:text> {
  applet = document.<xsl:value-of select="replace(translate(@name,'.','_'),'\W+','')"/><xsl:text>Applet</xsl:text>;
			<xsl:for-each select="./command">applet.evalCommand("<xsl:value-of select="."/>");</xsl:for-each>applet.setErrorDialogsActive(false);
	var a = 0;
    while(a != applet.getObjectNumber()){
	    setHypothesisObjectFeel(applet.getObjectName(a));
		a++;
    }
	}

	function setHypothesisObjectFeel(objectName){

        applet.setLabelVisible(objectName, true);
				applet.setLabelStyle(objectName, 3);
				applet.setLineStyle(objectName,0);
				 applet.setPointStyle(objectName,2);
}</script>
	</xsl:template>

	<!--father node is exercise-->
	<xsl:template match="interactiveExercise">
		<form>
			<input type="button">
				<xsl:attribute name="onclick">
					<xsl:text>ConstructionOf</xsl:text>
					<xsl:value-of select="replace(translate(../@name,'.','_'),'\W+','')"/>
					<xsl:text>();</xsl:text>
				</xsl:attribute>
				<xsl:attribute name="value">
					<xsl:if test="//page/@language='english'">Start</xsl:if>
					<xsl:if test="//page/@language='中文'">开始</xsl:if>
				</xsl:attribute>
			</input>
		</form>
		<xsl:apply-templates select="customToolBar"/>
		<form>
			<p>Answer:<input style="WIDTH: 150px; HEIGHT: 20px" size="50" id="inputField"/>
				<input onclick="judge();" type="button" value="submit"/>
			</p>
		</form>
		<script type="text/javascript">var applet;
		function ConstructionOf<xsl:value-of select="replace(translate(../@name,'.','_'),'\W+','')"/><xsl:text>()</xsl:text> {
  applet = document.<xsl:value-of select="replace(translate(../@name,'.','_'),'\W+','')"/><xsl:text>Applet</xsl:text>;
			<xsl:for-each select="./hypothesisConstruction/construction">applet.evalCommand("<xsl:value-of select="./label"/>=<xsl:value-of select="./object"/>");</xsl:for-each>
			<xsl:for-each select="./objectiveConstruction/construction">applet.evalCommand("<xsl:value-of select="./label"/>=<xsl:value-of select="./object"/>");</xsl:for-each>applet.setVisible(hiddenObj[0],false);
applet.registerAddListener("AddListenerFunction");
setHypothesisFeel(applet);
	}
	

	
	var hypothesisConstruction = new Array(<xsl:for-each select="./hypothesisConstruction/construction[not(position()=last())]">
	"<xsl:value-of select="./label"/>=<xsl:value-of select="./object"/>",</xsl:for-each>
	"<xsl:value-of select="./hypothesisConstruction/construction[last()]/label"/>=<xsl:value-of select="./hypothesisConstruction/construction[last()]/object"/>");

var objectiveConstruction = new Array(	"<xsl:value-of select="./objectiveConstruction/construction/label"/>=<xsl:value-of select="./objectiveConstruction/construction/object"/>");

var objectiveObjName = new Array("<xsl:value-of select="./objectiveConstruction/construction/label"/>");

var hiddenObj = new Array("<xsl:value-of select="./objectiveConstruction/construction/label"/>");

Judge(applet,document.getElementById("inputField"),hypothesisConstruction,objectiveConstruction,objectiveObjName,hiddenObj);</script>
	</xsl:template>

	<xsl:template match="customToolBar">
		<applet archive="file:///D:/Workspace/GTextbook/src/geogebra/geogebra.jar" code="geogebra.GeoGebraApplet" codebase="./" height="400" width="500">
			<xsl:attribute name="name">
				<xsl:value-of select="replace(translate(../../@name,'.','_'),'\W+','')"/>
				<xsl:text>Applet</xsl:text>
			</xsl:attribute>
			<param name="filename">
				<xsl:attribute name="value">
					<xsl:text>file:///D:/Workspace/GTextbook/src/geogebra/blank.ggb</xsl:text>
				</xsl:attribute>
			</param>
			<param name="framePossible" value="false"/>
			<param name="showAlgebraInput" value="false"/>
			<param name="showMenuBar" value="false"/>
			<param name="customToolBar">
				<xsl:attribute name=" value">
					<xsl:value-of select="value"/>
				</xsl:attribute>
			</param>
			<param name="showToolBar" value="true"/>Sorry, the GeoGebra Applet could not be started. Please make sure that
            Java 1.4.2 (or later) is installed and activated. (<a href="http://java.sun.com/getjava">click here to install
            Java now</a>)</applet>
	</xsl:template>


	<xsl:template match="dynamicFigure">
		<p>
			<a>
				<xsl:attribute name="name">
					<xsl:value-of select="@name"/>
				</xsl:attribute>
			</a>
			<applet archive="file:///D:/Workspace/GTextbook/src/geogebra/geogebra.jar" code="geogebra.GeoGebraApplet" codebase="./" height="400" name="ggbApplet" width="500">

				<param name="filename">
					<xsl:attribute name="value">
						<xsl:if test="@src">
							<xsl:value-of select="@src"/>
						</xsl:if>
						<xsl:if test="not(@src)">
							<xsl:text>file:///D:/Workspace/GTextbook/src/geogebra/blank.ggb</xsl:text>
						</xsl:if>
					</xsl:attribute>
				</param>
				<param name="framePossible" value="false"></param>
				<param name="showResetIcon" value="true"></param>
				<param name="enableRightClick" value="true"></param>
				<param name="showMenuBar" value="false"></param>
				<param name="showToolBar" value="false"></param>
				<param name="showToolBarHelp" value="false"></param>
				<param name="showAlgebraInput" value="true"></param>
			</applet>
		</p>
	</xsl:template>

	<!-- ********************************************************************
       
         Default rule (do NOT delete)
       
       ******************************************************************** -->

	<xsl:template match="*">
		<xsl:copy>
			<xsl:for-each select="@*">
				<xsl:copy/>
			</xsl:for-each>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. 保留所有权力.
<metaInformation>
<scenarios/><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->